package com.lvyq.myplayer.model.history
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.lvyq.myplayer.dao.PlayHistoryDao
/**
 * 文件描述：PlayHistoryViewModel
 * 作者：lvyq
 * 创建时间：2025-06-16
 * 修改时间：2025-06-16
 */

class PlayHistoryViewModelFactory(private val historyDao: PlayHistoryDao) : ViewModelProvider.Factory {
    override fun <T : ViewModel> create(modelClass: Class<T>): T {
        if (modelClass.isAssignableFrom(PlayHistoryViewModel::class.java)) {
            return PlayHistoryViewModel(historyDao) as T
        }
        throw IllegalArgumentException("Unknown ViewModel class")
    }
}